import org.springframework.web.context.request.RequestContextHolder as RCH 

class SchoolService {
 
    boolean transactional = true
    String store = "home"
// 检查是否到期
    def checkExpire(id) {
        def school = School.get(id)
        if (school.enable && school.end > new Date()) {
            true
        }else{
            false
        }
    }

    def mkdir(id) {
        log.info(RCH.requestAttributes.servletContext.getRealPath('/' + store + '/' + id))
        def dir = new File(RCH.requestAttributes.servletContext.getRealPath('/' + store + '/' + id)) 
        dir.mkdirs()

    }
}
